3.3.12 \(\int \cos (c+d x) \sin (a+b x) \, dx\) [212]

Optimal. Leaf size=43 \[ -\frac {\cos (a-c+(b-d) x)}{2 (b-d)}-\frac {\cos (a+c+(b+d) x)}{2 (b+d)} \]

[Out]

-1/2*cos(a-c+(b-d)*x)/(b-d)-1/2*cos(a+c+(b+d)*x)/(b+d)

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 43, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 2, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {4670, 2718} \begin {gather*} -\frac {\cos (a+x (b-d)-c)}{2 (b-d)}-\frac {\cos (a+x (b+d)+c)}{2 (b+d)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]*Sin[a + b*x],x]

[Out]

-1/2*Cos[a - c + (b - d)*x]/(b - d) - Cos[a + c + (b + d)*x]/(2*(b + d))

Rule 2718

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 4670

Int[Cos[w_]^(q_.)*Sin[v_]^(p_.), x_Symbol] :> Int[ExpandTrigReduce[Sin[v]^p*Cos[w]^q, x], x] /; IGtQ[p, 0] &&
IGtQ[q, 0] && ((PolynomialQ[v, x] && PolynomialQ[w, x]) || (BinomialQ[{v, w}, x] && IndependentQ[Cancel[v/w],
x]))

Rubi steps

\begin {align*} \int \cos (c+d x) \sin (a+b x) \, dx &=\int \left (\frac {1}{2} \sin (a-c+(b-d) x)+\frac {1}{2} \sin (a+c+(b+d) x)\right ) \, dx\\ &=\frac {1}{2} \int \sin (a-c+(b-d) x) \, dx+\frac {1}{2} \int \sin (a+c+(b+d) x) \, dx\\ &=-\frac {\cos (a-c+(b-d) x)}{2 (b-d)}-\frac {\cos (a+c+(b+d) x)}{2 (b+d)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.21, size = 43, normalized size = 1.00 \begin {gather*} -\frac {\cos (a-c+(b-d) x)}{2 (b-d)}-\frac {\cos (a+c+(b+d) x)}{2 (b+d)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]*Sin[a + b*x],x]

[Out]

-1/2*Cos[a - c + (b - d)*x]/(b - d) - Cos[a + c + (b + d)*x]/(2*(b + d))

________________________________________________________________________________________

Maple [A]
time = 0.12, size = 40, normalized size = 0.93

method result size
default \(-\frac {\cos \left (a -c +\left (b -d \right ) x \right )}{2 \left (b -d \right )}-\frac {\cos \left (a +c +\left (b +d \right ) x \right )}{2 \left (b +d \right )}\) \(40\)
risch \(-\frac {\cos \left (b x -d x +a -c \right )}{2 \left (b -d \right )}-\frac {\cos \left (b x +d x +a +c \right )}{2 \left (b +d \right )}\) \(41\)
norman \(\frac {\frac {2 b \left (\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{b^{2}-d^{2}}+\frac {2 b \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{2}-d^{2}}-\frac {4 d \tan \left (\frac {b x}{2}+\frac {a}{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{b^{2}-d^{2}}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \left (1+\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}\) \(115\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)*sin(b*x+a),x,method=_RETURNVERBOSE)

[Out]

-1/2*cos(a-c+(b-d)*x)/(b-d)-1/2*cos(a+c+(b+d)*x)/(b+d)

________________________________________________________________________________________

Maxima [A]
time = 0.26, size = 40, normalized size = 0.93 \begin {gather*} -\frac {\cos \left (b x + d x + a + c\right )}{2 \, {\left (b + d\right )}} - \frac {\cos \left (-b x + d x - a + c\right )}{2 \, {\left (b - d\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*sin(b*x+a),x, algorithm="maxima")

[Out]

-1/2*cos(b*x + d*x + a + c)/(b + d) - 1/2*cos(-b*x + d*x - a + c)/(b - d)

________________________________________________________________________________________

Fricas [A]
time = 3.97, size = 42, normalized size = 0.98 \begin {gather*} -\frac {b \cos \left (b x + a\right ) \cos \left (d x + c\right ) + d \sin \left (b x + a\right ) \sin \left (d x + c\right )}{b^{2} - d^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*sin(b*x+a),x, algorithm="fricas")

[Out]

-(b*cos(b*x + a)*cos(d*x + c) + d*sin(b*x + a)*sin(d*x + c))/(b^2 - d^2)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 155 vs. \(2 (34) = 68\).
time = 0.32, size = 155, normalized size = 3.60 \begin {gather*} \begin {cases} x \sin {\left (a \right )} \cos {\left (c \right )} & \text {for}\: b = 0 \wedge d = 0 \\\frac {x \sin {\left (a - d x \right )} \cos {\left (c + d x \right )}}{2} + \frac {x \sin {\left (c + d x \right )} \cos {\left (a - d x \right )}}{2} + \frac {\sin {\left (a - d x \right )} \sin {\left (c + d x \right )}}{2 d} & \text {for}\: b = - d \\\frac {x \sin {\left (a + d x \right )} \cos {\left (c + d x \right )}}{2} - \frac {x \sin {\left (c + d x \right )} \cos {\left (a + d x \right )}}{2} + \frac {\sin {\left (a + d x \right )} \sin {\left (c + d x \right )}}{2 d} & \text {for}\: b = d \\- \frac {b \cos {\left (a + b x \right )} \cos {\left (c + d x \right )}}{b^{2} - d^{2}} - \frac {d \sin {\left (a + b x \right )} \sin {\left (c + d x \right )}}{b^{2} - d^{2}} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*sin(b*x+a),x)

[Out]

Piecewise((x*sin(a)*cos(c), Eq(b, 0) & Eq(d, 0)), (x*sin(a - d*x)*cos(c + d*x)/2 + x*sin(c + d*x)*cos(a - d*x)
/2 + sin(a - d*x)*sin(c + d*x)/(2*d), Eq(b, -d)), (x*sin(a + d*x)*cos(c + d*x)/2 - x*sin(c + d*x)*cos(a + d*x)
/2 + sin(a + d*x)*sin(c + d*x)/(2*d), Eq(b, d)), (-b*cos(a + b*x)*cos(c + d*x)/(b**2 - d**2) - d*sin(a + b*x)*
sin(c + d*x)/(b**2 - d**2), True))

________________________________________________________________________________________

Giac [A]
time = 0.42, size = 40, normalized size = 0.93 \begin {gather*} -\frac {\cos \left (b x + d x + a + c\right )}{2 \, {\left (b + d\right )}} - \frac {\cos \left (b x - d x + a - c\right )}{2 \, {\left (b - d\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*sin(b*x+a),x, algorithm="giac")

[Out]

-1/2*cos(b*x + d*x + a + c)/(b + d) - 1/2*cos(b*x - d*x + a - c)/(b - d)

________________________________________________________________________________________

Mupad [B]
time = 0.84, size = 85, normalized size = 1.98 \begin {gather*} -\frac {b\,\left (\frac {\cos \left (a-c+b\,x-d\,x\right )}{2}+\frac {\cos \left (a+c+b\,x+d\,x\right )}{2}\right )}{b^2-d^2}-\frac {d\,\left (\frac {\cos \left (a-c+b\,x-d\,x\right )}{2}-\frac {\cos \left (a+c+b\,x+d\,x\right )}{2}\right )}{b^2-d^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)*sin(a + b*x),x)

[Out]

- (b*(cos(a - c + b*x - d*x)/2 + cos(a + c + b*x + d*x)/2))/(b^2 - d^2) - (d*(cos(a - c + b*x - d*x)/2 - cos(a
 + c + b*x + d*x)/2))/(b^2 - d^2)

________________________________________________________________________________________